home *** CD-ROM | disk | FTP | other *** search
/ Floppyshop 2 / Floppyshop - 2.zip / Floppyshop - 2.iso / diskmags / 0022-3.564 / dmg-3451 / data / gary.dat < prev    next >
Text File  |  1987-04-21  |  5KB  |  127 lines

  1. Source for "Gary The Phantom Sea-Lion of Old London Town" from the 
  2. Better Than Life Demo, by Wheee the fibble.
  3.  
  4.    Ok, this is the source to the old version of the screen I had 
  5. in the Better Than Life Demo (which, of course, everyone has got). 
  6. It isn't quite finished as it stands, but I've lost the new 
  7. version (or at least, I found this one and now can't be bothered 
  8. hunting for a newer version). So, here it is... (It's a bit of a 
  9. mess, sorry...)
  10.  
  11. 5 on error goto 10000
  12.  
  13.    Just set up the error trap.
  14.  
  15. 10 mode 0 : key off : hide : flash off : curs off : auto back off 
  16.    : update off 
  17.  
  18.     Initialise everything.
  19.  
  20. 11 load "p_tale.prg",7
  21.  
  22.     Load the music into bank 7 (this file must be in the same directory 
  23.     when you run this!)
  24.  
  25. 12 unpack 4,back
  26.  
  27.     Unpack the font (I think it's the font anyway).
  28.  
  29. 13 for T=0 to 15 : colour T,0 : next T : colour 15,$777
  30.  
  31.     Black the palette.
  32.  
  33. 15 reserve as work 10,186000 : fill start(10) to start(10)+length(10),0 
  34.    : A1=0 : B1=0 : cls physic : wait vbl
  35.  
  36.     Reserve the memory for the font, clear it, set up some vars 
  37.     and clear the screen.
  38.      
  39. 20 Y=0 : for T=32 to 90 : zoom back,A1,B1,A1+31,B1+18 to physic,17,0,302
  40.    ,18 : copy physic,physic+19*160 to start(10)+Y*160 : Y=Y+20 
  41.    : A1=A1+32 : if A1>288 then A1=0 : B1=B1+20
  42.  
  43.    Zoom the font right across the screen, but keep the same Y-
  44.    size. Then copy the zoomed font to bank 10 and move the co-
  45.    ordinates for the zoom along.
  46.  
  47. 21 next T : Y=0 : P=0 : CUR=start(10) : H=0 : cls physic : wait vbl 
  48.  
  49.    Finish the loop and set up some vars.
  50.  
  51. 27 unpack 5,physic : get palette (physic) : wait vbl : H=0 
  52.    : colour 1,$730 : for T=1 to 9 : colour T,$777 : next T
  53.    : colour 11,$777 : colour 13,$777 : colour 15,$777 : call start(7)+28
  54.  
  55.     Unpack the background and get the palette. The call 
  56.     start(7)+28 will start up the music.
  57.  
  58. 30 repeat : for Y=0 to 19 : for T=0 to 3 : areg(0)=physic : dreg(0)=16 
  59.    : dreg(1)=3 : dreg(2)=304 : dreg(3)=200 : areg(1)=physic : dreg(4)=16 
  60.    : dreg(5)=0 : call start(1)+28 : for D=0 to 3 : areg(0)=CUR+P 
  61.    : dreg(0)=16 : dreg(1)=Y : dreg(2)=304 : dreg(3)=Y+1 
  62.    : areg(1)=physic : dreg(4)=16 : dreg(5)=197+D : call start(1)+28
  63.    : next D : update : doke $FF825C,(psg(8)/2)*256 
  64.    : doke $FF8258,(psg(9)/2)*16 : doke $FF8254,psg(10)/2 : next T 
  65.    : next Y
  66.  
  67.     Hmmm, quite a long line... I wonder what it all does... 
  68.     Hmmmmm... Well, the general gist it that you copy the screen 
  69.     up by 3 pixels and copy the same 1 pixel high line 3 times at 
  70.     the bottom of the screen (ie, to 197,198 and 199). You do this 
  71.     for the 20 lines height of the font 3 times and it looks like your 
  72.     font is over 200 pixels high! In case you're wondering what 
  73.     all of the DREG business is about, it's a routine called "Bitcopy" 
  74.     which lets you copy individual bitplanes of the screen rather
  75.     than all four. Phone Colin Watt on 041 779 3868 if you want 
  76.     more information on it... The doke $ff... will put the colour 
  77.     value of the volume of the note on each of the voices directly
  78.     into the hardware register for that colour.
  79.  
  80. 40 P=(peek(start(9)+H)-32)*20*160 : H=H mod 2196+1 : until inkey$<>"" 
  81.    : call start(7)+28 : end
  82.  
  83.     The peek will read the next letter (ASCII, 32 to 90) from the
  84.     bank and mutiply it up so that the program will find it in the 
  85.     memory bank. The H = H mod 2196+1 will move H along so that 
  86.     next time round the next character is read from the bank.
  87.     The CALL will turn the music off (space's been pressed).
  88.  
  89. 1000 clw : reserve as screen 14 : cls 14 : for T=32 to 90 : home 
  90.      : print chr$(T) : A$(T)=screen$(physic,0,0 to 16,8) : next T
  91.  
  92.       This seems to be disabled in the program, dunno why. Maybe 
  93.       it isn't finished yet... Anyway, it isn't very 
  94.       important so I wont explain it...
  95.  
  96. 1002 home : print " " : wait vbl : S=start(8) : H=0 : A1=0 : B1=0 
  97.      : P=32 : unpack 5,physic : wait vbl : colour 1,$730
  98. 1010 for H=0 to 123 : for X=0 to 1 : screen copy 14,20,0,324,8 to 
  99.      14,16,0 : screen copy 14,16,0,304,8 to physic,16,0 : wait vbl 
  100.      : next X : cls 14,0,304,0 to 320,8 : screen$(14,304,0)=A$(P) 
  101.      : P=peek(S+H)
  102. 1012 next H
  103. 1020 for T=0 to 60 : screen copy physic,20,0,324,14 to physic,16,0 
  104.      : wait vbl : next T : erase 14 : for T=32 to 90 : A$(T)="" 
  105.      : next T : fade 2 : wait 14 : return 
  106.  
  107. 10000 flash 0,"(222,3)(000,3)" : print errn,errl : repeat 
  108.       : until peek($FFFC02)=57 : end 
  109.  
  110.        Error trap.
  111.  
  112.  
  113.    Well, I hope that's clear. Sorry that it isn't the finished 
  114. version, but it can't be helped (well I suppose it could be 
  115. really, but never mind). It isn't a very good bit of code really, 
  116. but I was quite pleased with it when I first wrote it so it still 
  117. has some nostalgic value I suppose. Anyway, I'll be off now. Bye 
  118. then...
  119.  
  120.     Wheee the fibble. September. 1991.
  121.  
  122. note from editor: Gary may think he is the 'The Phantom sea-lion 
  123. of old London town', but this is a title that has belonged to a 
  124. certain J.R.Hartley for the last decade.
  125.  
  126.  
  127.